﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FBS.Framework;

namespace AgileSaude.Web
{
    public partial class SiteAgile : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["Logou"] != null)
            //{
            //    if (bool.Parse(Session["Logou"].ToString()) == true)
            //    {
            //        Session["Logou"] = false;
            //        //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('../Geral/MinhasInformacoes.aspx','_blank')", true);
            //        Response.Redirect("../Geral/MinhasInformacoes.aspx", "_blank", "menubar=1,scrollbars=1,width=780,height=900,top=10");
            //        //Response.Redirect("../Geral/MinhasInformacoes.aspx", "_blank", "");
            //    }
            //}
        }

        protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
        {
            try
            {
                if (e.Exception != null)
                {
                    ScriptManager1.AsyncPostBackErrorMessage = e.Exception.ToString();
                    try
                    {
                        if (true)
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "ResultadoConfirmação", "alert('" + e.Exception.ToString() + "');", true);
                            Util.GravarLog(e.Exception.Message, "AgileSaude");
                        }
                    }
                    catch
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "ResultadoConfirmação", "alert('" + e.Exception.ToString() + "');", true);
                        Util.GravarLog(e.Exception.Message, "AgileSaude");
                    }
                }

            }
            catch (Exception ex)
            {
                ScriptManager1.AsyncPostBackErrorMessage = ex.Message;
                Util.GravarLog(ex.Message, "AgileSaude");
            }

        }
    }
}